import os,sys
path = os.getcwd()+"\\サクラメントの十二宫 乱れる仔ひつじと手懐く狼\\" #path
FileNameList = os.listdir(path+"ExtractInnerQuota\\")
dirs = os.listdir(path+"Translated\\")
SourceFileName = "ストパニもの01(eiq)"
for SourceFileName in FileNameList:
    list = []
    print("list reset")
    for dir in dirs:    
        if SourceFileName[0:len(SourceFileName)-4] in dir:
            print(dir)
            f1 = open(path+"\\Translated\\"+dir,"r",encoding='utf-8')
            text_lines = f1.readlines()
            for line in text_lines:
                list.append(line)
            f1.close()
            with open(path+"RenpyOriginalScript\\"+SourceFileName+".txt","w",encoding="utf-8") as f2:
                for ScriptText in list:
                    f2.write(ScriptText)
                f2.close()
            continue